package javabasic.threads.quqian;

public class Bankcount02 {
    private int sum=500;
    public synchronized void quxian(){
        if (this.sum>=100){
            this.sum-=100;
            System.out.println(Thread.currentThread().getName()+"取钱100");
        }else {
            System.out.println("账户余额不足");
        }
    }
}
